package OOP.InnerClass;

public class Member_Inner_class {
    public static void main(String[] args) {
        outer o = new outer();
        o.test();
        //第一种方法
        outer.Inner i = o.new Inner();
        //第二种方法第二步
        outer.Inner i1 = o.getInnerInstence();
    }
}

class outer{
    private int x;
    public class Inner{
        public void print(){
            System.out.println("x = " + x);
        }
    }
    //第二种方法第一步
    public Inner getInnerInstence(){
        return new Inner();
    }

    public void test(){
        Inner inner = new Inner();
        inner.print();
    }
}
